package elcom.model.common;

import org.apache.log4j.xml.DOMConfigurator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Log {
	private static Logger logErr = null;
	private static Logger logInfo = null;
	
	private static void ClogInfo(){
		DOMConfigurator.configureAndWatch(System.getProperty("user.home")
				+ java.io.File.separator + "configlog.log4j.xml");
		logInfo = LoggerFactory.getLogger("LogInfo");
	}
	
	private static void ClogErr(){
		DOMConfigurator.configureAndWatch(System.getProperty("user.home")
				+ java.io.File.separator + "configlog.log4j.xml");
		logErr = LoggerFactory.getLogger("LogError");
	}
	
	public static void logInfo(String info){
		if (logInfo == null) {
			ClogInfo();
		}
		logInfo.info(info);
	}
	
	public static void logErr(String err) {
		if (logErr == null) {
			ClogErr();
		}
		logErr.error(err);
	}
}
